<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:fmt="http://java.sun.com/jsp/jstl/fmt">
<head>
    <meta charset="UTF-8">
    <title>MyPetStore</title>
    <link rel="Stylesheet" href="../css/jpetstore.css" type="text/css" media="screen"/>
</head>
<body>
<div th:replace="common/top">
</div>

<div id="Content">
    <div id="BackLink">
        <a th:href="@{'/catalog/product?productId='+${product.productId}}" th:text="'Return to'+${product.productId}">返回上一级</a>
    </div>

    <div id="Catalog">

        <table>
            <tr>
                <td><img th:src="${session.imgsrc}"></td>
<!--                <td><img th:src="${}"></td>-->
            </tr>
            <tr >
                <td th:text="${session.description}"></td>
            </tr>
            <tr>
                <td><b th:text="${item.itemId}"></b></td>
            </tr>
            <tr>
                <font size="4" >
                <td th:text="${item.attribute1!=null?item.attribute1:''}+' '+${item.attribute2!=null?item.attribute2:''}+' '+${item.attribute3!=null?item.attribute3:''}+' '+${item.attribute4!=null?item.attribute4:''}+' '+${item.attribute5!=null?item.attribute5:''}+' '+${product.name}">
                </td></font>
            </tr>
            <tr>
                <td th:text="${product.name}"></td>
            </tr>
            <tr>
                <td th:if="${item.quantity <= 0}">
                    Back ordered.
                </td>
                <td th:if="${item.quantity > 0}" th:text="${item.quantity}+' in stock.'">
                </td>
            </tr>
            <tr>
                <td>
                    <fmt:formatNumber th:text="${'$'+#numbers.formatDecimal(item.listPrice,0,'COMMA',2,'POINT')}" />
                </td>
            </tr>

            <tr>
                <td>
                    <a class="Button" th:href="@{'/cart/addItemToCart?workingItemId='+${item.itemId}}">Add to Cart</a>
                </td>
            </tr>
        </table>

    </div>
</div>

<div th:replace="common/bottom">
</div>
</body>
</html>